$(function () {
    $("#grid_xshtlyzk_detail").datagrid({
        url: $.webPath() + "/report/xshtlyzk/xshtlyzk_detail_list?htId=" + $("#toolbar_xshtlyzk_detail [name='htId']").val(),
        toolbar: "#grid_xshtlyzk_detail",
        fitColumns: true,
        singleSelect: true,
        fit: true,
        striped: true,
        rownumbers: true,
        showFooter: true,
        columns: [
            [
                {field: 'xsdh', title: '销售单号', align: 'center', width: 100},
                {field: 'gg.code', title: '物资编码', align: 'center', width: 100},
                {field: 'gg.name', title: '物资名称', align: 'center', width: 100},
                {field: 'gg.ggxh', title: '规格型号', align: 'center', width: 100},
                {field: 'shj', title: '赎货价', align: 'center', width: 100, formatter: function (value) {
                    var val = formatSlForHtml(value);
                    return val;
                }},
                {field: 'cksl', title: '出库数量', align: 'center', width: 100, formatter: function (value) {
                    var val = formatSlForHtml(value);
                    return val;
                }},
                {field: 'kpzt', title: '开票', align: 'center', width: 100, formatter: function (value) {
                    if(value == 1)
                    return "已开票";
                    else
                    return "未开票";
                }}
            ]
        ],
        onLoadSuccess: function () {
            $(".datagrid-htable .datagrid-cell").css('text-align', 'center');
        }
    });
});
